package com.edu.service.impl;

import com.edu.javaBean.Department;
import com.edu.javaBean.User;
import com.edu.mapper.DepartmentMapper;
import com.edu.mapper.UserMapper;
import com.edu.service.DeptService;
import com.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DepartmentMapper deptMapper;
    @Override
    public List<Department> getAllDepts(String keywords) {
        return deptMapper.getAllDepts(keywords);
    }

    @Override
    public int updateDept(Department dept) {
        return deptMapper.updateByPrimaryKeySelective(dept);
    }

    @Override
    public int addDept(Department dept) {
        return deptMapper.insertSelective(dept);
    }

    @Override
    public int deleteDeptById(int id) {
        return deptMapper.deleteDeptById(id);
    }

}
